package tgc.edu.demo.jkxt.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import tgc.edu.demo.jkxt.custom.BaseEntity;

@Entity
@Table(name = "shijuan")
public class Shijuan extends BaseEntity<Integer>{
		private String name;
		private Course coures;
		private List<Question> question;
		@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
		private Date create_time;
		@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
		private Date update_time;
		private Integer zongfen;
		private Integer jige;
		private Integer danXuanFen;
		private Integer duoXuanFen;
		private Integer panDuanFen;
		private Integer danXuanNum;
		private Integer duoXuanNum;
		private Integer panDuanNum;
		
		
		
		public Integer getDanXuanNum() {
			return danXuanNum;
		}


		public void setDanXuanNum(Integer danXuanNum) {
			this.danXuanNum = danXuanNum;
		}


		public Integer getDuoXuanNum() {
			return duoXuanNum;
		}


		public void setDuoXuanNum(Integer duoXuanNum) {
			this.duoXuanNum = duoXuanNum;
		}


		public Integer getPanDuanNum() {
			return panDuanNum;
		}


		public void setPanDuanNum(Integer panDuanNum) {
			this.panDuanNum = panDuanNum;
		}


		public Integer getDanXuanFen() {
			return danXuanFen;
		}


		public void setDanXuanFen(Integer danXuanFen) {
			this.danXuanFen = danXuanFen;
		}


		public Integer getDuoXuanFen() {
			return duoXuanFen;
		}


		public void setDuoXuanFen(Integer duoXuanFen) {
			this.duoXuanFen = duoXuanFen;
		}


	

		public Integer getPanDuanFen() {
			return panDuanFen;
		}


		public void setPanDuanFen(Integer panDuanFen) {
			this.panDuanFen = panDuanFen;
		}


		public Integer getZongfen() {
			return zongfen;
		}


		public void setZongfen(Integer zongfen) {
			this.zongfen = zongfen;
		}


		public Integer getJige() {
			return jige;
		}


		public void setJige(Integer jige) {
			this.jige = jige;
		}


		public Date getCreate_time() {
			return create_time;
		}


		public void setCreate_time(Date create_time) {
			this.create_time = create_time;
		}


		public Date getUpdate_time() {
			return update_time;
		}


		public void setUpdate_time(Date update_time) {
			this.update_time = update_time;
		}


		public String getName() {
			return name;
		}


		public void setName(String name) {
			this.name = name;
		}

		@ManyToOne
		public Course getCoures() {
			return coures;
		}
		public void setCoures(Course coures) {
			this.coures = coures;
		}

		@OneToMany(cascade = CascadeType.REFRESH ,fetch = FetchType.LAZY)
		@JoinTable(name = "shijuan_question",joinColumns = {@JoinColumn(name="shijuan_id")},inverseJoinColumns = {@JoinColumn(name="question_id")})
		public List<Question> getQuestion() {
			return question;
		}
		public void setQuestion(List<Question> question) {
			this.question = question;
		}


		@Override
		public String toString() {
			return "Shijuan [name=" + name + ", coures=" + coures + ", question=" + question + ", create_time=" + create_time + ", update_time=" + update_time + "]";
		}



		
}
